<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <!-- 找出数组里最大的素数 -->
    <script>
      let arr = [78, 56, 99, 56, 23, 45, 23, 36]
      for (let i = 0; i < arr.length; i++) {
        let age = 1
        for (let j = 2; j < i; j++) {
          if (arr[i] % arr[j] == 0) {
            age = 0
          }
        }
        max = arr[0]
        if (age) {
          if (arr[i] > max) {
            max = arr[i]
          }
        }
      }
      console.log(max)
    </script>
  </body>
</html>
